﻿using System.Text;
using OpenWaves.EPiServer.Localization.Transformations;

namespace OpenWaves.EPiServer.Localization
{
    public static class TransformationsRepository
    {
        private static readonly Encoding TemplateEncoding = Encoding.Default;

        public static string GetStaticTranslationTemplate()
        {
            return GetTranslationTemplate(LocalizationResources.StaticTranslationKeysTemplate) + GetCommonTranslationTemplate();
        }

        public static string GetObjectOrientedTranslationTemplate()
        {
            return GetTranslationTemplate(LocalizationResources.ObjectOrientedTranslationKeysTemplate) + GetCommonTranslationTemplate();
        }

        internal static string GetCommonTranslationTemplate()
        {
            return GetTranslationTemplate(LocalizationResources.CommonTranslationKeysTemplate);
        }

        private static string GetTranslationTemplate(byte[] translationTemplateContent)
        {
            return TemplateEncoding.GetString(translationTemplateContent).Trim();
            
        }
    }
}
